package org.clusterbomb.core.engine;

/**
 * Stages are the only hardwired aspect of a build lifecyle.
 * 
 * There are only five, and they are enumerated here.  
 * 
 * @author jeffp
 *
 */

public enum DeploymentStage {
	
	DEPLOYMENT_START("deployment-start"), 
	SERVER_GROUP_START("server-group-start"), 
	SERVER("server"),
	SERVER_GROUP_END("server-group-end"),
	DEPLOYMENT_END("deployment-end");
	
	private final String id;
	
	private DeploymentStage(String id) {
		this.id = id;
	}
	
	public String getId() {
		return id;
	}
	
	public DeploymentStage findById(String id) {
		for (DeploymentStage stage : DeploymentStage.values()) {
			if (stage.getId().equals(id)) {
				return stage;
			}
		}
		
		return null;
	}

}
